package net.huashitong.Project.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;

import net.huashitong.Project.dao.FilesDao;
import net.huashitong.Project.entity.Files;

@Service
public class FilesService extends StringPKService<Files> {

	@Autowired
	private SysTableService tableService;
	
	@Autowired
	private FilesDao dao;
	
	@Override
	protected BaseDao<Files, String> getDao() {
		return dao;
	}
	
	@Override
	protected void beforeSave(Files obj) {
		obj.setSysId(tableService.updateMaxSysId("t_bnp_file", null));
	}
	
	public List<Files> query(String projectId,String nodeId){
		return dao.query(projectId, nodeId);
	}
	public List<Files> queryByAcceptId(String projectId,String acceptNodeId){
		return dao.queryByAcceptId(projectId, acceptNodeId);
	}
	public List<Files> queryBySendId(String projectId,String sendNodeId){
		return dao.queryBySendId(projectId, sendNodeId);
	}
	public List<Files> queryByProjectId(String projectId){
		return dao.queryByProjectId(projectId);
	}
}
